﻿namespace fpsrpg.Loot
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    class WeaponDropChances
    {
        #region Fields

        /// <summary>
        /// The chance of a drop in a certain rarity.
        /// </summary>
        static float[] Rarity = 
          {
           0.7f, //White
           0.2f, //Green
           0.09f, //Blue
           0.0075f, //Epic
           0.0020f, //Yellow
           0.0004f,//Gold
           0.0001f //Orange
          };

        /// <summary>
        /// The probability of a weapon of a certain type dropping
        /// </summary>
        static float[] WeaponType = { 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7 };

        #endregion Fields

        #region Methods

        /// <summary>
        /// This is a todo function for generating items
        /// </summary>
        /// <param name="diceRoll"></param>
        void GenerateDrop(float diceRoll)
        {
            for (byte quality = 0; quality < Rarity.Length; quality++)
            {
                if (diceRoll < 1 - Rarity[quality + 1])
                    break;
            }
        }

        #endregion Methods
    }
}